<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>生成方案管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>

<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <h5>报表区域字段列表 </h5>
        </div>
        <div class="ibox-content">
            <form:form id="inputForm" modelAttribute="genScheme" action="${ctx}/gen/genScheme/save" method="post" class="form-horizontal">
                <form:hidden path="id"/><form:hidden path="flag"/>
                <%--<form:input path="moduleName" htmlEscape="false" maxlength="500" class="required input-xlarge"/>--%>
                <form:hidden path="subModuleName"/>
                <sys:message content="${message}"/>

                <table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
                    <tbody>
                    <%--<tr>--%>
                        <%--<td class="width-15 active"><label class="pull-right">方案名称：</label></td>--%>
                        <%--<td class="width-85">--%>
                            <%--<form:input path="name" htmlEscape="false" maxlength="200" class="form-control input-xlarge required"/>--%>

                            <%--<span class="help-inline"><font color="red">*</font> </span>--%>
                        <%--</td>--%>
                    <%--</tr>--%>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">业务表名：</label></td>
                        <td class="width-85">
                            <form:select path="genTable.id" class="required input-xlarge form-control">
                                <form:options items="${tableList}" itemLabel="nameAndComments" itemValue="id" htmlEscape="false"/>
                            </form:select>
                            <span class="help-inline">生成的数据表，一对多情况下请选择主表。</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">模板分类：</label></td>
                        <td class="width-85">
                            <form:select path="category" class="required input-xlarge form-control">
                                <form:options items="${config.categoryList}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                            </form:select>
                            <span class="help-inline">
					生成结构：{包名}/{模块名}/{分层(dao,entity,service,web)}/{子模块名}/{java类}
				</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">生成包路径：</label></td>
                        <td class="width-85">
                            <form:input path="packageName" htmlEscape="false" maxlength="500" class="required input-xlarge"/>
                            <span class="help-inline">建议模块包：com.thinkgem.jeesite.modules</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">生成模块名：</label></td>
                        <td class="width-85">
                            <form:input path="moduleName" htmlEscape="false" maxlength="500" class="required input-xlarge"/>
                            <span class="help-inline">可理解为子系统名，例如 sys</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">生成功能描述：</label></td>
                        <td class="width-85">
                            <form:input path="functionName" htmlEscape="false" maxlength="500" class="required input-xlarge"/>
                            <span class="help-inline">将设置到类描述</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">生成功能名称：</label></td>
                        <td class="width-85">
                            <form:input path="functionNameSimple" htmlEscape="false" maxlength="500" class="required input-xlarge"/>
                            <span class="help-inline">用作功能提示，如：保存“某某”成功</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">生成功能作者：</label></td>
                        <td class="width-85">
                            <form:input path="functionAuthor" htmlEscape="false" maxlength="500" class="required input-xlarge"/>
                            <span class="help-inline">功能开发者</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">表单模型：</label></td>
                        <td class="width-85">
                            <form:select path="type" cssClass="input-xlarge form-control">
                                <form:options items="${fns:getDictList('gen_scheme_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                            </form:select>
                        </td>
                    </tr>
                    <tr>
                        <td class="width-15 active"><label class="pull-right">生成选项：</label></td>
                        <td class="width-85">
                            <form:checkbox path="replaceFile" label="是否替换现有文件" cssClass="i-checks form-control " />
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div class="form-actions">
                    <shiro:hasPermission name="gen:genScheme:edit">
                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保存方案" onclick="$('#flag').val('0');"/>&nbsp;
                        <input id="btnSubmit" class="btn btn-danger" type="submit" value="保存并生成代码" onclick="$('#flag').val('1');"/>&nbsp;
                    </shiro:hasPermission>
                    <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
                </div>
            </form:form>
        </div>
    </div>
</div>


</body>
</html>
